<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld" %>

<stripes:useActionBean var="appInject" binding="/AppInject.action" event="inject" executeResolution="false"/>

<c:forEach var="app" items="${appInject.apps}">
    [<a href='javascript:(function() {
    var i = document.getElementById("injected");
    if(i != null) {
        i.parentNode.removeChild(i);
    }
    var b = null;
    <c:forEach var="js" items="${app.injectjs}">
        b = document.createElement("script");
        b.src = "${js}";
        document.body.appendChild(b);
    </c:forEach>

    var s = document.createElement("script");
    s.id = "injected";
    s.src = "http://localhost:8080/ai/app_inject.jsp?action=${app.name}";
    document.body.appendChild(s);
    })();'>${app.displayName}</a>]<br/>
</c:forEach>
